package com.netease.pris.activity;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.LinearLayout;
import com.netease.framework.ActivityEx;
import com.netease.pris.a.h;

public class MBlogBindActivity extends ActivityEx
{
  public static final String a = "prisblog://oauth_callback";
  public static final String b = "http://graph.renren.com/oauth/login_success.html";
  public static final String c = "http://yuedu.163.com/redirect_uri";
  private static final String e = "bind_type";
  private final String d = "MBlogBindActivity";
  private int f;
  private LinearLayout g;
  private WebView h;
  private com.netease.b.b.e.c i;
  private boolean j = false;
  private boolean k = false;
  private int l;
  private com.netease.b.b.e.d m = new ck(this);

  public static String a(String paramString)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("<h1><center>");
    localStringBuilder.append(paramString);
    localStringBuilder.append("<h1><center>");
    return localStringBuilder.toString();
  }

  public static void a(Context paramContext, int paramInt)
  {
    Intent localIntent = new Intent(paramContext, MBlogBindActivity.class);
    localIntent.putExtra("bind_type", paramInt);
    localIntent.setFlags(268435456);
    paramContext.startActivity(localIntent);
  }

  private void a(boolean paramBoolean1, boolean paramBoolean2)
  {
    LinearLayout localLinearLayout = this.g;
    int n;
    if (paramBoolean1)
    {
      n = 0;
      localLinearLayout.setVisibility(n);
      if (!paramBoolean2)
        break label46;
      this.h.setVisibility(0);
      this.h.requestFocus();
    }
    while (true)
    {
      return;
      n = 8;
      break;
      label46: this.h.setVisibility(8);
    }
  }

  private String b(Context paramContext, int paramInt)
  {
    int n = 0;
    switch (paramInt)
    {
    default:
    case 1:
    case 3:
    case 2:
    case 6:
    case 5:
    case 4:
    case 7:
    }
    while (true)
    {
      return paramContext.getString(n);
      n = 2131362077;
      continue;
      n = 2131362078;
      continue;
      n = 2131362079;
      continue;
      n = 2131362080;
      continue;
      n = 2131362081;
      continue;
      n = 2131362082;
      continue;
      n = 2131362083;
    }
  }

  private void b()
  {
    if (this.f == 1)
      this.l = com.netease.b.b.f.a.a().a(this.m);
    while (true)
    {
      return;
      if (this.f == 3)
      {
        this.l = com.netease.b.b.g.c.a().a(this.m);
        continue;
      }
      if (this.f == 4)
      {
        this.l = com.netease.b.b.b.a.a().a(this.m);
        continue;
      }
      if (this.f == 2)
      {
        this.l = com.netease.b.b.d.c.a().a(this.m);
        continue;
      }
      if (this.f == 5)
      {
        this.l = com.netease.b.b.a.b.a().a(this.m);
        continue;
      }
      if (this.f == 6)
      {
        this.l = com.netease.b.b.c.a.a().a(this.m);
        continue;
      }
      if (this.f != 7)
        continue;
      this.l = com.netease.b.b.h.d.a().a(this.m);
    }
  }

  private void c()
  {
    if (this.f == 1)
      com.netease.b.b.f.a.a().a(this.l);
    while (true)
    {
      return;
      if (this.f == 3)
      {
        com.netease.b.b.g.c.a().a(this.l);
        continue;
      }
      if (this.f == 4)
      {
        com.netease.b.b.b.a.a().a(this.l);
        continue;
      }
      if (this.f == 2)
      {
        com.netease.b.b.d.c.a().a(this.l);
        continue;
      }
      if (this.f == 5)
      {
        com.netease.b.b.a.b.a().a(this.l);
        continue;
      }
      if (this.f == 6)
      {
        com.netease.b.b.c.a.a().a(this.l);
        continue;
      }
      if (this.f != 7)
        continue;
      com.netease.b.b.h.d.a().a(this.l);
    }
  }

  private void c(String paramString)
  {
    String str1 = null;
    if ((paramString != null) && (paramString.startsWith("prisblog://oauth_callback")))
    {
      String[] arrayOfString = paramString.substring(1 + "prisblog://oauth_callback".length()).split("&");
      int i6 = 0;
      String str4 = null;
      if (i6 < arrayOfString.length)
      {
        String str5 = arrayOfString[i6];
        if (str5.startsWith("oauth_token="))
          str1 = str5.substring(1 + "oauth_token".length());
        while (true)
        {
          i6++;
          break;
          if (!str5.startsWith("oauth_verifier="))
            continue;
          str4 = str5.substring(1 + "oauth_verifier".length());
        }
      }
      this.i.a(str1, str4);
      return;
    }
    int i4;
    String str3;
    if ((paramString != null) && (paramString.startsWith("http://graph.renren.com/oauth/login_success.html")))
    {
      int i3 = paramString.indexOf("access_token=");
      if (i3 == -1)
        break label316;
      i4 = i3 + "access_token=".length();
      int i5 = paramString.indexOf("&", i4);
      if ((i5 != -1) && (i5 > i4))
        str3 = paramString.substring(i4, i5);
    }
    while (true)
    {
      this.i.a(str3, null);
      break;
      str3 = paramString.substring(i4);
      continue;
      if ((paramString == null) || (!paramString.startsWith("http://yuedu.163.com/redirect_uri")))
        break;
      int n = paramString.indexOf("code=");
      int i1;
      String str2;
      if (n != -1)
      {
        i1 = n + "code=".length();
        int i2 = paramString.indexOf("&", i1);
        if ((i2 != -1) && (i2 > i1))
          str2 = paramString.substring(i1, i2);
      }
      while (true)
      {
        this.i.a(null, str2);
        break;
        str2 = paramString.substring(i1);
        continue;
        str2 = null;
      }
      label316: str3 = null;
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    Intent localIntent = getIntent();
    if (localIntent == null)
      finish();
    while (true)
    {
      return;
      this.f = localIntent.getIntExtra("bind_type", 0);
      if (this.f == 0)
      {
        h.a(this, 2131362042);
        finish();
        continue;
      }
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = b(this, this.f);
      setTitle(getString(2131362041, arrayOfObject));
      setContentView(2130903056);
      this.g = ((LinearLayout)findViewById(2131558447));
      this.h = ((WebView)findViewById(2131558446));
      this.h.setVerticalScrollBarEnabled(false);
      this.h.setHorizontalScrollBarEnabled(false);
      this.h.setWebViewClient(new cz(this, null));
      this.h.getSettings().setJavaScriptEnabled(true);
      a(true, false);
      b();
    }
  }

  protected void onDestroy()
  {
    c();
    super.onDestroy();
  }

  protected void onNewIntent(Intent paramIntent)
  {
    com.netease.g.b.c("MBlogBindActivity", "onNewIntent:" + this.j);
    super.onNewIntent(paramIntent);
    if (this.j == true)
    {
      c(paramIntent.getData().toString().toString());
      this.k = true;
    }
    while (true)
    {
      return;
      finish();
    }
  }

  protected void onResume()
  {
    com.netease.g.b.c("MBlogBindActivity", "onResume:" + this.j);
    super.onResume();
    if ((this.j) && (!this.k))
      finish();
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.MBlogBindActivity
 * JD-Core Version:    0.6.0
 */